<template>
  <div>
    <!-- 查询条件 -->
    <div class="head-container">
      <el-form :inline="true" :model="query" size="small">
        <el-form-item label="支付时间">
          <dateSelect ref="dateSelect" @handleTime="getDate" />
        </el-form-item>
        <el-button
          size="mini"
          type="primary"
          icon="el-icon-search"
          class="filter-item"
          @click="toQuery()"
        >查询</el-button>
        <el-button size="mini" icon="el-icon-refresh" class="filter-item" @click="reset()">重置</el-button>
      </el-form>
    </div>
    <div class="overtable-btns spe-btn">
      <span class="table-title">抵扣记录</span>
      <el-button size="mini" type="warning" icon="el-icon-download">报表导出</el-button>
    </div>
    <!-- 表格 -->
    <!-- v-loading="loading" -->
    <el-table :data="datahh" tooltip-effect="dark" size="small">
      <el-table-column type="index" label="序号" fixed="left" />
      <el-table-column prop="ii" label="支付时间" width="200">
        <template slot-scope="scope">
          <span>{{scope.row.ii}}</span>
        </template>
      </el-table-column>
      <el-table-column prop="ee" label="抵扣金额" width="130" />
      <el-table-column prop="qq" label="订单金额" />
      <el-table-column prop="rr" label="关联订单号" width="100" />
      <el-table-column label="操作" width="90" fixed="right">
        <template slot-scope="scope">
          <el-button size="small" type="text">详情</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!--分页组件-->
    <el-pagination
      :total="total"
      :current-page="page"
      :pager-count="5"
      style="margin-top: 8px;"
      layout="total, prev, pager, next, sizes, jumper"
      @size-change="sizeChange"
      @current-change="pageChange"
    />
  </div>
</template>

<script>
import dateSelect from '@/components/DateSelect/index'
import initTable from '@/mixins/initTable'
export default {
  mixins: [initTable],
  components: {
    dateSelect
  },
  data() {
    return {
      datahh: [
        {
          qq: '2016-05-02',
          ww: '王小虎',
          ee: '上海',
          rr: '普陀区',
          tt: '上海市普陀区',
          yy: '200333',
          uu: '17612775057',
          ii: 'hahahahha',
          oo: '上海市普陀区',
          pp: '200333',
          aa: '17612775057',
          ss: 'hahahahha',
          dd: 'hahahahha'
        },
        {
          qq: '2016-05-02',
          ww: '王小虎',
          ee: '上海',
          rr: '普陀区',
          tt: '上海市普陀区',
          yy: '200333',
          uu: '17612775057',
          ii: 'hahahahha',
          oo: '上海市普陀区',
          pp: '200333',
          aa: '17612775057',
          ss: 'hahahahha',
          dd: 'hahahahha'
        }
      ]
    }
  },
  methods: {
    // 时间选择
    getDate({ startTime, endTime, val }) {
      this.query.startTime = startTime
      this.query.endTime = endTime
    },
    reset() {
      this.toReset()
      this.$refs.dateSelect.clearDate()
      this.$refs.areaSelect.clearArea()
    }
  }
}
</script>

<style lang="scss" scoped>
</style>